﻿using Batman.Cms.Core.Utils;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Omu.ValueInjecter.Utils;
using Senparc.Weixin.MP.Containers;
using SixLabors.ImageSharp;

namespace Batman.Jianbei.Forum.Config
{
    public class WeixinSetting
    {
        private WeixinSetting()
        {
        }

        static WeixinSetting()
        {
            // 从appsettings中获取数据
            var weixinAppId = AppSettingsUtil.DefaultInstance.Get("SenparcWeixinSetting:WeixinAppId");
            var weixinSecret = AppSettingsUtil.DefaultInstance.Get("SenparcWeixinSetting:WeixinAppSecret");
            weixin_app_id = weixinAppId;
            weixin_secret = weixinSecret;
            
            AccessTokenContainer.Register(weixin_app_id, weixin_secret);
        }

        /// <summary>
        /// 微信公众号appid
        /// </summary>
        public static readonly string weixin_app_id;

        /// <summary>
        /// 微信公众号secret
        /// </summary>
        public static readonly string weixin_secret;
    }
}
